#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QColorDialog>
#include <QDebug>
#include <QColor>
#include <QFileDialog>

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
}

MainWindow::~MainWindow()
{
    delete ui;
}


void MainWindow::on_pushButton_clicked()
{
//    QColor color = QColorDialog::getColor(QColor(0,255,255),this,"请设置颜色");
// //    qDebug()<<color;
// //    QString stylen = "background-color: rgb(" + QString::number(color.red()) + ","
// //                     + QString::number(color.green()) + ","
// //                     + QString::number(color.blue()) + ")";
//    char stylen[]={0};
//    sprintf(stylen,"background-color:rgb(%d,%d,%d)",color.red(),color.green(),color.blue());
//    this->setStyleSheet(stylen);
    QString filepath = QFileDialog::getSaveFileName(this,"打开文件");
    qDebug()<<filepath;
}

void MainWindow::on_pushButton_2_clicked()
{
    QString filepath = QFileDialog::getOpenFileName(this,"打开文件");
    qDebug()<<filepath;
}
